<template>
  <view class="invoice-apply-list">
    <view class="search">
      <nut-icon
        font-class-name="iconfont"
        class-prefix="iconfont"
        name=".icon-sousuokuang_sousuo"
        size="16"
        color="#cccccc"
        :style="{ margin: '0 3px 0 17px' }"
      />
      <input class="search-input" type="text" placeholder="单号查询" />
    </view>
    <view class="filter">
      <view class="filter-right">
        <view class="type-state">
          <text>全部类型</text>
          <nut-icon
            font-class-name="iconfont"
            class-prefix="iconfont"
            name=".icon-xialajiantou"
            size="24"
            color="#999999"
          />
        </view>
        <view class="type-state" style="margin: 0 0 0 16px">
          <text>全部状态</text>
          <nut-icon
            font-class-name="iconfont"
            class-prefix="iconfont"
            name=".icon-xialajiantou"
            size="24"
            color="#999999"
          />
        </view>
      </view>
      <view class="filter-left">
        <text>筛选</text>
        <nut-icon
          font-class-name="iconfont"
          class-prefix="iconfont"
          name=".icon-sousuokuang_sousuo"
          size="16"
          color="#cccccc"
        />
      </view>
    </view>
    <view>
      <view>
        <view class="top">
          <text>申请单号</text>
          <view>
            <view class="number">
              <text>100182627</text>
              <text>普通开票</text>
            </view>
            <text>待提交</text>
          </view>
        </view>
        <!-- <view>
          <view>
            <text>发票类型:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>申请日期:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>开票日期:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>开票机构:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>创建人:</text>
            <text>我是内容</text>
          </view>
          <view>
            <text>总金额:</text>
            <text>我是内容</text>
          </view>
        </view>
        <view>
          <text>编辑</text>
          <text>提交</text>
          <text>查看</text>
        </view> -->
      </view>
    </view>
    <yh_dialog
      v-model="dialogShow"
      hint="请确认是否提交？"
      sureText="确认提交"
      :handleCancel="() => {dialogShow = false;}"
      :handleSure="handleDialogSure"
    />
    <yh_dialog_textarea
      v-model="dialogTextareaShow"
      hint="请确认是否撤销？"
      placeholder="请填写撤销原因～"
      sureText="撤销"
      :handleCancel="() => {dialogTextareaShow = false;}"
      :handleSure="handleDialogTextareaSure"
    />
  </view>
</template>

<script lang="ts">
import { reactive, toRefs,ref } from "vue";
import yh_dialog from "@/components/yh-dialog.vue";
import yh_dialog_textarea from "@/components/yh-dialog-textarea.vue";

export default {
  name: "invoice-apply-list",
  components: { yh_dialog, yh_dialog_textarea },
  setup() {
    const state = reactive({
      ordermu: "GQ-210610-1726-0004",
      time: "2021-10-20",
      dialogShow: true,
      dialogTextareaShow: false,
      textAreaContent: "",
    });
    const value = ref("");
    const handleDialogSure = () => {
      state.dialogShow = false;
    };
    const handleDialogTextareaSure = (value) => {
      console.log("qwerwqwewe");
      state.textAreaContent = value;
      console.log(value);
      state.dialogTextareaShow = false;
      console.log(state.textAreaContent);
    };
    return {
      value,
      handleDialogSure,
      handleDialogTextareaSure,
      ...toRefs(state),
    };
  },
};
</script>

<style lang="scss">
.invoice-apply-list {
  width: calc(100% - 24px);
  padding: 0 12px;
  background: #f4f4f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  .search {
    width: 100%;
    background: #ffffff;
    height: 28px;
    border-radius: 16px;
    display: flex;
    margin: 6px 4px;
    flex-direction: row;
    align-items: center;
    &-input {
      font-size: 14px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      color: #cccccc;
      line-height: 20px;
    }
  }
  .filter {
    width: 100%;
    height: 28px;
    margin: 12px 4px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    color: #333333;
    line-height: 16px;
    &-right {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      .type-state {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
      }
    }
    &-left {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }
  }
  .list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    .cell {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 100%;
      background: #ffffff;
      .top {
        display: flex;
        flex-direction: column;
        width: 100%;
        border-bottom: 1px solid #eeeeee;
        .label {
          font-size: 10px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: left;
          color: #999999;
          line-height: 18px;
        }
        .number-state {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          .number-tab {
            display: flex;
            flex-direction: row;
            align-items: center;
            .number {
              font-size: 13px;
              font-family: PingFangSC, PingFangSC-Medium;
              font-weight: 500;
              text-align: left;
              color: #262626;
              line-height: 18px;
            }
            .tab {
              width: 48px;
              height: 16px;
              opacity: 0.5;
              border: 1px solid #464557;
              border-radius: 1px;
            }
          }
        }
        .state {
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: right;
          color: #dc2734;
          line-height: 18px;
        }
      }
      .middle {
        display: flex;
        flex-direction: column;
        padding: 6px 16px;
        &-content {
          display: flex;
          flex-direction: row;
          padding: 4px 0;
          .label {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #999999;
            line-height: 17px;
          }
          .content {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            color: #666666;
            line-height: 17px;
          }
        }
      }
      .bottom {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        padding: 8px 16px 16px;
        .btn {
          width: 72px;
          height: 28px;
          opacity: 1;
          border: 1px solid #999999;
          border-radius: 2px;
          font-size: 13px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          color: #333333;
          line-height: 18px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-left: 8px;
        }
      }
    }
  }
}
</style>